package com.sc.passbook.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author sc
 * Created on  2018/9/1
 */
@Data
public class Response {
    private Integer code=200;
    private String msg;
    private Object data;


    public static Response success(){
        Response r = new Response();
        r.setCode(200);
        r.setMsg("success");
        return r;
    }

    public static Response success(Object data){
        Response r = new Response();
        r.setCode(200);
        r.setMsg("success");
        r.setData(data);
        return r;
    }
    public static Response fail(String msg){
        Response r  = new Response();
        r.setCode(500);
        r.setMsg(msg);
        return r;
    }
    public static Response fail(String msg,Object data){
        Response r  = new Response();
        r.setCode(500);
        r.setMsg("fail");
        r.setData(data);
        return r;
    }
}
